package org.web.common.sso.client.biz.impl;

import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class CookieRule {

    // 写入cookie的path,非必配置项，默认是根路径“/”.
    private String cookiePath = "/";
    // 写入cookie,设置httpOnly, 非必配置项,默认为true.
    private boolean cookieHttpOnly = true;
    // 写入cookie,试用SSL需要设置成true, 非必配置项,默认为false.
    private boolean cookieSecure = false;
    // 写入cookie,version信息，非必配置项, 默认为0，后续用于解析处理cookie信息.
    private int cookieVersion = 0;

    /***
     *  写入cookie,detail see <a href="https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Access-Control-Max-Age">...</a>,
     *  <p>By default, <code>-1</code> is returned, which indicates that
     *  the cookie will persist until browser shutdown. 单位是秒。
     *  非必配置项,默认为-1.
     *  max-age有三种可能值：负数、0、正数。负数：有效期session；0：删除cookie；正数：有效期为创建时刻+ max-age
     */
    private int cookieMaxAge = -1;

}
